// 策略管理
import request from '@/utils/request'
// 查询售货机策略
export const vmPolicy = (innerCode) => {
  return request({
    url: `/api/vm-service/policy/vmPolicy/${innerCode}`
  })
}
// 策略搜索
export const policySearch = (params) => {
  return request({
    url: `/api/vm-service/policy/search`,
    params
  })
}
// 新增策略
export const addPolicy = (data) => {
  return request({
    url: `/api/vm-service/policy`,
    method: 'POST',
    data
  })
}
// 修改策略
export const editPolicy = (policyId, data) => {
  return request({
    url: `/api/vm-service/policy/${policyId}`,
    method: 'PUT',
    data
  })
}
// 删除策略
export const delPolicy = (policyId) => {
  return request({
    url: `/api/vm-service/policy/${policyId}`,
    method: 'DELETE'
  })
}
// 根据策略搜索售货机
export const policyVmList = (policyId, params) => {
  return request({
    url: `/api/vm-service/policy/vmList/${policyId}`,
    method: 'GET',
    params
  })
}
